From: Christian Hergert Date: Sun, 26 Dec 2021 20:47:45 +0000 (-0800) Subject: texthistory: always track selection bounds X-Git-Tag: archive/raspbian/4.6.5+ds-1+rpi1~1^2~91^2^2~3^2~1 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e7871fbc433fad592e227ead834346aa3db8a235;p=gtk4.git texthistory: always track selection bounds It's cheap to store the selection position, so always set it even if we are in a user section. Otherwise, we risk not having the right position when starting a delete action within a begin_user_action(), end_user_action() pair. Related #4575 --- diff --git a/gtk/gtktexthistory.c b/gtk/gtktexthistory.c index 3b9379ccc3..5f3f2cb56c 100644 --- a/gtk/gtktexthistory.c +++ b/gtk/gtktexthistory.c @@ -981,11 +981,8 @@ gtk_text_history_selection_changed (GtkTextHistory *self, return_if_applying (self); return_if_irreversible (self); - if (self->in_user == 0 && self->irreversible == 0) - { - self->selection.insert = CLAMP (selection_insert, -1, G_MAXINT); - self->selection.bound = CLAMP (selection_bound, -1, G_MAXINT); - } + self->selection.insert = CLAMP (selection_insert, -1, G_MAXINT); + self->selection.bound = CLAMP (selection_bound, -1, G_MAXINT); } void